package org.bite.lesson07;

public class Demo702 {
    public static void main(String[] args) throws InterruptedException {
        MyBlockingQueue myBlockingQueue = new MyBlockingQueue(3);
        myBlockingQueue.put(1);
        myBlockingQueue.put(2);
        myBlockingQueue.put(5);
        System.out.println("已经入队3个元素");
        myBlockingQueue.take();
        myBlockingQueue.take();
        myBlockingQueue.take();
        System.out.println("已经取出3个元素");
        myBlockingQueue.put(1);
        myBlockingQueue.put(2);
        myBlockingQueue.put(5);
        System.out.println("已经入队3个元素");

        myBlockingQueue.take();
        myBlockingQueue.take();
        System.out.println("已经取出2个元素");
        myBlockingQueue.put(4);
        myBlockingQueue.put(4);
        System.out.println("已经入队2个元素");
    }
}
